package com.domino.hacettepeadisyon;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class Veritabani extends SQLiteOpenHelper {
	
	private static final String VERITABANI_ADI="HcttpAdisyon";
	private static final int SURUM=1;

	public Veritabani(Context c)
	{
		super(c, VERITABANI_ADI, null, SURUM);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {

		db.execSQL("CREATE TABLE adisyon (adisyon_ID INT, masa_no INT, madi_soyadi TEXT, huecart_ID INT, bakiye double, miktar float, yemek_ID INT)");
		db.execSQL("CREATE TABLE yemekler (yemek_ID INT, yemekadi TEXT)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXIST adisyon");
		db.execSQL("DROP TABLE IF EXIST yemekler");
		onCreate(db);
	}

}
